Game Programming in C++: Creating 3D Games by Sanjay Madhav

Game Programming in C++: Creating 3D Games by Sanjay Madhav

Author:Sanjay Madhav
Language: eng
Format: epub, pdf
Publisher: Addison-Wesley
Published: 2018-03-22T04:00:00+00:00


0

0

None

0

1

Pressed

1

0

Released

1

1

Held

Consider how you might use this for a game where the player can hold a key to charge up an attack. On the frame on which you detect the Pressed state of the key, you begin charging the attack. Then as long as the key’s state on subsequent frames remains Held, you continue to charge the attack. Finally, when the key’s state becomes Released, it means the player let go of the key, and you can now execute the attack with the appropriate charge level.

But for actions such as just moving forward if W is 1, you’d rather just use the old approach, where you check the value of the input on that frame. In this chapter’s input system, you will give the option of either querying this basic value or querying for the different input states.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.